<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!--标准mui.css-->
    <link rel="stylesheet" href="../static/weixinKp/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="../static/weixinKp/css/app.css" />
    <title>个人中心</title>
</head>

<body>
    <div class="userinfo">
        <div class="headimg">

        </div>
        <p class='welcome'>欢迎您：<span id="username"></span></p>
    </div>
    <div class="invoice" onclick="InvoiceWays(this,'','')">
        <img src="./images/f_icon_09.png" alt="" class="invoimg"> <span>历史开票</span>
        <img src="./images/right.png" alt="" class="icon-more">
    </div>
    <div class="invoice" style="margin:0px;" onclick="InvoiceWays(this,3,1)">
        <img src="./images/f_icon_07.png" alt="" class="invoimg"> <span>作废发票</span>
        <img src="./images/right.png" alt="" class="icon-more">
    </div>
    <div class="invoice" style="margin:0px;" onclick="InvoiceWays(this,3,2)">
        <img src="./images/f_icon_08.png" alt="" class="invoimg"> <span>红冲发票</span>
        <img src="./images/right.png" alt="" class="icon-more">
    </div>
    <div class="invoice" style="margin:0px;" onclick="InvoiceWays(this,1)">
        <img src="./images/f_icon_06.png" alt="" class="invoimg"> <span>取消开票    </span>
        <img src="./images/right.png" alt="" class="icon-more">
    </div>
    <footer>
        <div id="o">
            <img src="./images/ic_08.png" alt="">
            <p>首页</p>
        </div>
        <div id="t">
            <img src="./images/ic_09.png" alt="">
            <p>代开票</p>
        </div>
        <div>
            <img src="./images/ic_07.png" alt="">
            <p class="wcolor">个人中心</p>
        </div>
    </footer>
    <script src="../static/weixinKp/js/mui.min.js"></script>
    <script src="../static/weixinKp/js/jquery-3.2.1.min.js" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
        var username=document.cookie.split(";")[0].split("=")[1];
        $("#username").text(username);
        $('#t').click(() => {
		    if(!username){
		        mui.alert('请先登录！',function(){
		            window.location.replace('./login.html');
		        })
				return;
		    }else{
                var issigncustomer = document.cookie.split(";")[2].split("=")[1];
				if(issigncustomer==1){
					window.location.href = "./test.html?id=2111";
				}else{
					mui.alert('您还不是签约客户，请联系您的客户经理，开通此功能！');
				}
			}
        })
        $('#o').click(() => {
            window.location.replace("./index.html?id=1222");
        });
        function InvoiceWays(e, state, type) {
            if (!username) {
                mui.alert('请先登录！', function() {
                    window.location.replace('./login.html');
                })
                return;
            }else{
                var issigncustomer = document.cookie.split(";")[2].split("=")[1];
				if(issigncustomer==1){
                    var text = $(e).find('span').text();
                    window.location.href = './historyInvioce.html?text=' + text + '&type=' + type + '&state=' + state;
				}else{
					mui.alert('您还不是签约客户，请联系您的客户经理，开通此功能！');
				}
			}

        }
    </script>
</body>

</html>
